package lib.bone.common.exception;

import lib.bone.common.constant.ResponseCodeConst;
import lombok.Data;

@Data
public class BusinessException extends RuntimeException{
    Integer code;

    public BusinessException(){}
    public BusinessException(String message){
        super(message);
    }
    public BusinessException(String message, Throwable cause){
        super(message, cause);
    }
    public BusinessException(Throwable cause){
        super(cause);
    }
    public BusinessException(ResponseCodeConst responseCodeConst){
        super(responseCodeConst.getMsg());
        this.code = responseCodeConst.getCode();
    }
    public BusinessException(ResponseCodeConst responseCodeConst,String msg){
        super(msg);
        this.code = responseCodeConst.getCode();
    }
    public BusinessException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }

}
